<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/admin.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<script type="text/javascript" src="../SpryAssets/SpryValidationTextField.js"></script>
<script src="../SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<link rel="icon" href="../images/icon.jpg"/>
<link rel="stylesheet" type="text/css" href="../SpryAssets/SpryValidationTextField.css"/>
<link href="../SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="../css/admincss.css"/>
<script type="text/javascript">
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2");
</script>
<title>Tin Từng Giây</title>

</head>
<body>

<div id="wrapper">
  <div id="header"> 
    
    <div id="top-header" class="clearfix">
        <a href="#" id="logo" class="clearfix">
           <img src="../images/4468766.jpg">
      <h3>Tin <br/><span>Từng Giây</span></h3></a>
               
    </div>
  
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<hr />
  <p align="center" style="color:#3C6; font-size:24px;">Trang Admin quản trị:</p>
  <table width="979" border="1">
    <tr>
      <td width="389" height="289">
        <ul id="MenuBar2" class="MenuBarVertical">
          <li><a class="MenuBarItemSubmenu" href="#">Quản Lý Tin </a>
            <ul>
              <li><a href="?trang=tinhienthi">Tin hiện thị</a></li>
              <li><a href="?trang=tinan">Tin ẩn</a></li>
            </ul>
          </li>
          <li><a href="#" class="MenuBarItemSubmenu">Quản lý User</a>
            <ul>
              <li><a href="?trang=thanhvien">Thành viên</a></li>
              <li><a href="?trang=editor">Editor</a></li>
            </ul>
          </li>
          <li><a href="?trang=quangcao">Quản lý quảng cáo</a></li>
          <li><a href="?trang=binhluan">Quản l&yacute; b&igrave;nh luận</a></li>
        </ul>
      </td>
      <td width="574"><p style="font-size:18px">Hôm nay: </p>
      <div id="date" align="center" ></div>
      <script type="text/javascript">
		
		document.getElementById('date').innerHTML = Date()</script>
      </p>
      <p style="font-size:18px">&nbsp;</p>
      <p style="font-size:18px">Editer: </p>
      <p style="font-size:18px">1. Ngô Đức Hưng: <a href="mailto:dajcajt@gmail.com">dajcajt@gmail.com</a></p>
      <p style="font-size:18px">2. Đỗ Văn Cường: <a href="mailto:docuong96@gmail.com">docuong96@gmail.com</a></p> 
      </td>
    </tr>
    
  </table>
  <table>
  <tr>
      
      <td align="justify" width="973"><!-- InstanceBeginEditable name="main" --><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	  <?php
	  include('mysql.php');
	if(isset($_POST['hientin'])){
		$tieude=$_POST['hientin'];
		$r="update tintuc set Anhienthi=1 where 
		Tieude='$tieude'";
		$q=mysqli_query($dbc,$r) or die(mysqli_error($dbc));
		if(mysqli_affected_rows($dbc)){
				echo "<script>alert('Thao tác hiện thị thành công');</script>";
		}
	}
?>
<?php
	if(isset($_POST['xoatin'])){
		$tieude=$_POST['xoatin'];
		$r="delete from tintuc where Tieude='$tieude'";
		$q=mysqli_query($dbc,$r) or die(mysqli_error($dbc));
		if(mysqli_affected_rows($dbc)){
				echo "<script>alert('Thao tác Xóa thành công');</script>";
		}
	}
?>
      <table width="969" border="0.5px" id="bang1" wdth="631">
          <tr>
          	<th width="63" height="23">Thứ tự</th>
            <th width="97" height="23" style="">Thể loại</th>
            <th width="121" height="23">Tiêu đề</th>
            <th width="175" height="23">Tóm tắt</th>
            <th width="146" align="center">Người đăng</th>
            <th width="149" align="center">Ngày đăng</th>
            <th width="188" align="center">Thao tác</th>
          </tr>
<?php
	$r="select b.tenTL,a.Tieude,a.Tomtat,c.Hoten,a.ngaydang from tintuc as a,theloai as b,user as c where a.IDtheloai=b.IDtheloai and a.IDUser=c.IDUser and a.Anhienthi=0";
	$q=mysqli_query($dbc,$r);
	$dem=1;
	while($row=mysqli_fetch_array($q)){
?>
<script>
	function anhien(id,layten){
		var tieude=document.getElementById(layten).value;
		document.getElementById(id).value=tieude;
		document.getElementById(id,layten)
		tieude.style.Color = red;
	}
	
</script>
          <tr id="demo">
          <td width="63" height="32" align="right"><?php echo $dem ?></td>
            <td style="font-size:16px"><?php echo $row['tenTL']; ?></td>
            <td><input id="tieude<?php echo $dem; ?>" readonly="readonly" value="<?php echo $row['Tieude']; ?>" on="mau()"/></td>
            <td><?php echo $row['Tomtat']; ?></td>
            <td><?php echo $row['Hoten']; ?></td>
            <td><?php echo $row['ngaydang']; ?></td>
            <td>
            <form style="text-align:center" id="form2" name="form2" method="post" action="mysql.php">
            
            <input type="hidden" name="hientin" id="hientin<?php echo $dem;?>" />
            <input type="hidden" name="xoatin" id="xoatin<?php echo $dem;?>" />
            
                   <input type="submit" name="button" id="xoa<?php echo $dem;?>" onmousemove="anhien(id='hientin<?php echo $dem;?>',layten='tieude<?php echo $dem;?>')" value="Hiện Thị tin" />
                    <input type="submit" name="button" id="xoa<?php echo $dem;?>" onmousemove="anhien(id='xoatin<?php echo $dem;?>',layten='tieude<?php echo $dem;?>')" value="Xóa tin" />
          
            </form></td></tr>
<?php $dem++;  } ?><!-- InstanceEndEditable --></td>
    </tr>
  </table>
  <br />
<br />

<div id="footer" class="clearfix">
  <p>Tin từng giây có bản quyền thuộc về Nhóm 3 lớp C1406IV</p>
</div>
</div>


<script type="text/javascript">
var MenuBar2 = new Spry.Widget.MenuBar("MenuBar2", {imgRight:"../SpryAssets/SpryMenuBarRightHover.gif"});
</script>
</body>
<!-- InstanceEnd --></html>